/* 全局样式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* 设置根元素宽度 */
#root {
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB',
    'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif, 'Apple Color Emoji',
    'Segoe UI Emoji', 'Segoe UI Symbol';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-color: #f5f5f5;
}

/* 自定义滚动条 */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* 布局相关 */
.ant-layout {
  min-height: 100vh;
}

.ant-layout-sider {
  box-shadow: 2px 0 8px 0 rgba(29, 35, 41, 0.05);
  z-index: 1000;
}

.ant-layout-header {
  box-shadow: 0 1px 4px rgba(0, 21, 41, 0.08);
  z-index: 999;
}

.ant-layout-content {
  background-color: #f5f5f5 !important;
  padding: 24px !important;
}

/* 修复Ant Design布局的width: 0问题 */
.ant-layout.ant-layout-has-sider > .ant-layout,
.ant-layout.ant-layout-has-sider > .ant-layout-content {
  width: auto !important;
}

/* 页面内容容器 */
.page-container {
  background: white;
  border-radius: 8px;
  padding: 24px;
  min-height: calc(100vh - 120px);
  box-shadow: 0 1px 2px -2px rgba(0, 0, 0, 0.16), 0 3px 6px 0 rgba(0, 0, 0, 0.12), 0 5px 12px 4px rgba(0, 0, 0, 0.09);
}

/* 卡片样式增强 */
.ant-card {
  box-shadow: 0 1px 2px -2px rgba(0, 0, 0, 0.16), 0 3px 6px 0 rgba(0, 0, 0, 0.12), 0 5px 12px 4px rgba(0, 0, 0, 0.09);
  border-radius: 8px;
  margin-bottom: 16px;
}

.ant-card-head {
  border-bottom: 1px solid #f0f0f0;
}

.ant-card-body {
  padding: 20px;
}

/* 表格样式增强 */
.ant-table {
  border-radius: 6px;
}

.ant-table-thead > tr > th {
  background: #fafafa;
  font-weight: 600;
}

/* 按钮样式增强 */
.ant-btn {
  border-radius: 6px;
  font-weight: 500;
}

.ant-btn-primary {
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.045);
}

/* 输入框样式增强 */
.ant-input,
.ant-input-affix-wrapper,
.ant-select-selector {
  border-radius: 6px;
}

/* 标签样式增强 */
.ant-tag {
  border-radius: 4px;
  font-weight: 500;
}

/* 进度条样式增强 */
.ant-progress-bg {
  border-radius: 3px;
}

/* 统计数值样式 */
.ant-statistic-title {
  color: #8c8c8c;
  font-size: 14px;
}

.ant-statistic-content {
  font-weight: 600;
}

/* 响应式调整 */
@media (max-width: 768px) {
  .ant-layout-sider {
    position: fixed !important;
    height: 100vh;
    z-index: 999;
  }
  
  .ant-layout-content {
    margin-left: 0 !important;
    padding: 16px !important;
  }
  
  .page-container {
    padding: 16px;
  }
}

/* 动画效果 */
.ant-card {
  transition: all 0.3s ease;
}

.ant-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* 自定义主题色 */
:root {
  --primary-color: #1890ff;
  --success-color: #52c41a;
  --warning-color: #faad14;
  --error-color: #ff4d4f;
  --info-color: #1890ff;
}

/* 状态指示器 */
.status-indicator {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 8px;
}

.status-indicator.healthy {
  background-color: var(--success-color);
}

.status-indicator.warning {
  background-color: var(--warning-color);
}

.status-indicator.error {
  background-color: var(--error-color);
}

/* 代码块样式 */
.code-block {
  background: #f6f8fa;
  border: 1px solid #e1e4e8;
  border-radius: 6px;
  padding: 16px;
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 13px;
  line-height: 1.45;
  overflow-x: auto;
}

/* 工具提示增强 */
.ant-tooltip {
  font-size: 12px;
}

/* 加载状态 */
.loading-container {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 40px;
}

/* 空状态 */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: #8c8c8c;
}

.empty-state .anticon {
  font-size: 48px;
  margin-bottom: 16px;
  color: #d9d9d9;
}

/* 页面标题样式 */
.page-title {
  margin-bottom: 24px;
}

.page-title h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 600;
  color: #262626;
}

.page-title .ant-typography {
  color: #8c8c8c;
  font-size: 16px;
  margin-top: 8px;
}

/* 分隔线样式 */
.ant-divider {
  margin: 24px 0;
}

/* 间距调整 */
.ant-space {
  gap: 16px !important;
}

.ant-row {
  margin-bottom: 16px;
}

/* 表单样式 */
.ant-form-item {
  margin-bottom: 20px;
}

.ant-form-item-label > label {
  font-weight: 500;
  color: #262626;
}
